const joi = require("joi");

const id = joi.number().required();
const parent_id = joi.number().allow(null).allow("");
const menu_type = joi.string().allow(null).allow("");
const path = joi.string().required();
const name = joi.string().required();
const icon = joi.string();
const title = joi.string();
const file_path = joi.string().required();

// 新增条件验证规则对象
exports.reg_menu_add_schema = {
  body: {
    parent_id,
    menu_type,
    path,
    name,
    icon,
    title,
    file_path,
  },
};
// 编辑规则
exports.reg_menu_edit_schema = {
  body: {
    id,
    parent_id,
    menu_type,
    path,
    name,
    icon,
    title,
    file_path,
  },
};
// 列表数据查询条件
exports.reg_menu_delete_schema = {
  params: {
    id,
  },
};
// 列表数据查询条件
exports.reg_menu_list_schema = {
  body: {},
};
